<?php
/*
   帐户团队业绩累计
*/
namespace common\models\finance;
use common\models\BaseModel;


class TeamTotalModel extends BaseModel
{
	public static function tableName()
	{
		return "{{%team_total}}";
	}

	public function rules() 
	{
		return [
			[['member_id','mch_id','invite_id'],'required'],
			[['total','team_total','my_total'],'double'],
			[['member_id'],'integer'],
			[['date'],'string']
		];
	}

	public static function getTeamTotal($mid)
	{
		return self::find()->where(['member_id'=>$mid,'mch_id'=>MCHID])->asarray()->one();
	}
}